home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / doc / unix / out < prev    next >
Encoding:
Text File  |  1992-12-06  |  45.8 KB  |  1,052 lines

  1.  
  2.  
  3.  
  4.  
  5.      COPYDB(UNIX)                 3/14/79                 COPYDB(UNIX)
  6.  
  7.  
  8.  
  9.      NAME
  10.           copydb - create batch files to copy out a data base and  re-
  11.           store it.
  12.  
  13.      SYNOPSIS
  14.           _c_o_p_y_d_b [ -_u_n_a_m_e ] database full-path-name-of-directory [ re-
  15.           lation ... ]
  16.  
  17.      DESCRIPTION
  18.           _C_o_p_y_d_b creates two INGRES command files  in  the  directory:
  19.           _C_o_p_y._o_u_t,  which  contains  Quel instuctions which will copy
  20.           all relations owned by the user  into  files  in  the  named
  21.           directory,  and _c_o_p_y._i_n, which contains instructions to copy
  22.           the files into relations, create indexes  and  do  modifies.
  23.           The files will have the same names as the relations with the
  24.           users INGRES id tacked on the end.  (The directory MUST  NOT
  25.           be the same as the data base directory as the files have the
  26.           same names as the relation files.) The -_u flag may  be  used
  27.           to  run  _c_o_p_y_d_b  with  a  different user id.  (The fact that
  28.           _c_o_p_y_d_b creates the copy files does not imply that  the  user
  29.           can necessarily access the specified relation).  If relation
  30.           names are specified only those relations will be included in
  31.           the copy files.
  32.  
  33.           _C_o_p_y_d_b is written in Equel and will access the  database  in
  34.           the  usual  manner.   It  does not have to run as the INGRES
  35.           user.
  36.  
  37.      EXAMPLE
  38.           chdir /mnt/mydir
  39.           copydb db /mnt/mydir/backup
  40.           ingres db <backup/copy.out
  41.           tp r1 backup
  42.           rm -r backup
  43.  
  44.           tp x1
  45.           ingres db <backup/copy.in
  46.  
  47.      DIAGNOSTICS
  48.           _C_o_p_y_d_b will give  self-explanatory  diagnostics.   If  ``too
  49.           many  indexes''  is  reported  it  means  that more than ten
  50.           indexes have been specified on one relation.   The  constant
  51.           can  be  increased and the program recompiled.  Other limits
  52.           are set to the system limits.
  53.  
  54.      BUGS
  55.           _C_o_p_y_d_b assumes that indexes which are ISAM do not need to be
  56.           remodified.  _C_o_p_y_d_b cannot tell if the relation was modified
  57.           with a fillfactor or minpages  specification.   The  _c_o_p_y._i_n
  58.           file may be edited to reflect this.
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.      CREATDB(UNIX)                11/6/79                CREATDB(UNIX)
  67.  
  68.  
  69.  
  70.      NAME
  71.           creatdb - create a data base
  72.  
  73.      SYNOPSIS
  74.           _c_r_e_a_t_d_b [ -_u_n_a_m_e ] [ -_e ] [ -_m ] [ +__c ] [ +__q ] dbname
  75.  
  76.      DESCRIPTION
  77.           Creatdb creates a  new  INGRES  database,  or  modifies  the
  78.           status  of  an  existing  database.  The person who executes
  79.           this command becomes the Database  Administrator  (DBA)  for
  80.           the database.  The DBA has special powers not granted to or-
  81.           dinary users.
  82.  
  83.           _D_b_n_a_m_e is the name of the database to be created.  The  name
  84.           must be unique among all INGRES users.
  85.  
  86.           The flags +__c and +__q specify options on  the  database.   The
  87.           form  +_x  turns  an option on, while -_x turns an option off.
  88.           The -_c flag turns off the concurrency  control  scheme  (de-
  89.           fault on).  The +_q flag turns on query modification (default
  90.           on).
  91.  
  92.           Concurrency control should not be turned off except on data-
  93.           bases  which are never accessed by more than one user.  This
  94.           applies even if users do not  share  data  relations,  since
  95.           system  relations are still shared.  If the concurrency con-
  96.           trol scheme is not installed in UNIX, or if the special file
  97.           /dev/lock does not exist or is not accessible for read-write
  98.           by INGRES, concurrency control acts  as  though  it  is  off
  99.           (although  it  will suddenly come on when the lock driver is
  100.           installed in UNIX).
  101.  
  102.           Query modification must be turned on for the protection, in-
  103.           tegrity,  and  view  subsystems to work, however, the system
  104.           will run slightly slower in some cases if it is  turned  on.
  105.           It  is  possible  to turn query modification on if it is al-
  106.           ready off in an existing database, but it is not possible to
  107.           turn it off if it is already on.
  108.  
  109.           Databases with query modification turned off create new  re-
  110.           lations  with all access permitted for all users, instead of
  111.           no access except to the owner,  the  default  for  databases
  112.           with query modification enabled.
  113.  
  114.           Database options for an existing database may be modified by
  115.           stating the -_e flag.  The database is adjusted to conform to
  116.           the option flags.  For example:
  117.  
  118.                   creatdb -e +q mydb
  119.  
  120.           turns query  modification  on  for  database  ``mydb''  (but
  121.           leaves  concurrency  control  alone).  Only the database ad-
  122.           ministrator (DBA) may use the -_e flag.
  123.  
  124.           When query modification is turned on, new relations will  be
  125.           created  with  no  access,  but previously created relations
  126.           will still have all access to everyone.  The _d_e_s_t_r_o_y command
  127.           may  be  used  to remove this global permission, after which
  128.           more selective permissions may be specified with the  _p_e_r_m_i_t
  129.           command.
  130.  
  131.           The INGRES user may use the -_u flag to specify  a  different
  132.           DBA:  the  flag  should be immediately followed by the login
  133.           name of the user who should be the DBA.
  134.  
  135.           The -_m flag specifies that the UNIX directory in  which  the
  136.           database  is  to reside already exists.  This should only be
  137.           needed if the directory if a mounted file system,  as  might
  138.           occur  for  a very large database.  The directory must exist
  139.           (as .../_d_a_t_a/_b_a_s_e/_d_b_n_a_m_e), must be mode  777,  and  must  be
  140.           empty of all files.
  141.  
  142.           The user who executes this command must have  the  U_CREATDB
  143.           bit set in the status field of her entry in the users file.
  144.  
  145.           The INGRES superuser can create a file in .../_d_a_t_a/_b_a_s_e con-
  146.           taining  a single line which is the full pathname of the lo-
  147.           cation of the database.  The file must be  owned  by  INGRES
  148.           and  be  mode 600.  When the database is created, it will be
  149.           created in the file named,  rather  than  in  the  directory
  150.           .../_d_a_t_a/_b_a_s_e.      For     example,     if     the     file
  151.           .../_d_a_t_a/_b_a_s_e/_e_r_i_c_d_b contained the line
  152.  
  153.                   /mnt/eric/database
  154.  
  155.           then the database  called  ``ericdb''  would  be  physically
  156.           stored  in  the  directory /mnt/eric/database rather than in
  157.           the directory .../data/base/ericdb.
  158.  
  159.      EXAMPLE
  160.           creatdb demo
  161.           creatdb -ueric -q erics_db
  162.           creatdb -e +q -c -u:av erics_db
  163.  
  164.      FILES
  165.           .../files/dbtmplt7
  166.           .../files/data/base/*
  167.           .../files/datadir/* (for compatibility  with  previous  ver-
  168.           sions)
  169.  
  170.      SEE ALSO
  171.           demodb(unix),   destroydb(unix),   users(files),   chmod(I),
  172.           destroydb(quel), permit(quel)
  173.  
  174.      DIAGNOSTICS
  175.           No database name specified.
  176.               You have not specified  the  name  of  the  database  to
  177.               create (or modify) with the command.
  178.           You may not access this database
  179.               Your entry in the users file says you are not authorized
  180.               to access this database.
  181.           You are not a valid INGRES user
  182.               You do not have a users file entry, and can not do  any-
  183.               thing with INGRES at all.
  184.           You are not allowed this command
  185.               The U_CREATDB bit is not set in your users file entry.
  186.           You may not use the -u flag
  187.               Only the INGRES superuser may become someone else.
  188.           <name> does not exist
  189.               With -_e or -_m, the directory does not exist.
  190.           <name> already exists
  191.               Without either -_e or -_m,  the  database  (actually,  the
  192.               directory) already exists.
  193.           <name> is not empty
  194.               With the -_m flag, the directory you named must be empty.
  195.           You are not the DBA for this database
  196.               With the -_e flag, you must be the  database  administra-
  197.               tor.
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.      DESTROYDB(UNIX)              3/14/79              DESTROYDB(UNIX)
  205.  
  206.  
  207.  
  208.      NAME
  209.           destroydb - destroy an existing database
  210.  
  211.      SYNOPSIS
  212.           _d_e_s_t_r_o_y_d_b [ -_s ] [ -_m ] dbname
  213.  
  214.      DESCRIPTION
  215.           _D_e_s_t_r_o_y_d_b will remove all reference to an existing database.
  216.           The directory of the database and all files in that directo-
  217.           ry will be removed.
  218.  
  219.           To execute this command the current user must be  the  data-
  220.           base  administrator for the database in question, or must be
  221.           the INGRES superuser and have the -_s flag stated.
  222.  
  223.           The -_m flag causes _d_e_s_t_r_o_y_d_b not to remove the UNIX directo-
  224.           ry.  This is useful when the directory is a separate mounted
  225.           UNIX file system.
  226.  
  227.      EXAMPLE
  228.           destroydb demo
  229.           destroydb -s erics_db
  230.  
  231.      FILES
  232.           .../data/base/*
  233.  
  234.      SEE ALSO
  235.           creatdb(unix)
  236.  
  237.      DIAGNOSTICS
  238.           invalid dbname - the database name specified is not a  valid
  239.               name.
  240.           you may not reference this database - the database  may  ex-
  241.               ist,  but you do not have permission to do anything with
  242.               it.
  243.           you may not use the -s flag - you have tried to use  the  -_s
  244.               flag, but you are not the INGRES superuser.
  245.           you are not the dba - someone else created this database.
  246.           database does not exist - this database does not exist.
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.      EQUEL(UNIX)                  3/14/79                  EQUEL(UNIX)
  255.  
  256.  
  257.  
  258.      NAME
  259.           equel - Embedded QUEL interface to C
  260.  
  261.      SYNOPSIS
  262.           _e_q_u_e_l [ -_d ] [ -_f ] [ -_r ] file.q ...
  263.  
  264.      DESCRIPTION
  265.           _E_q_u_e_l provides the user with a  method  of  interfacing  the
  266.           general  purpose programming language ``C'' with INGRES.  It
  267.           consists of the EQUEL pre-compiler and the EQUEL runtime li-
  268.           brary.
  269.  
  270.           _C_o_m_p_i_l_a_t_i_o_n
  271.  
  272.           The precompiler is invoked with the statement:
  273.  
  274.                _e_q_u_e_l [<flags>] file1.q [<flags>] file2.q ...
  275.  
  276.           where file_n.q are the source input file  names,  which  must
  277.           end with ._q.  The output is written to the file ``file_n.c''.
  278.           As many files as wished may be specified.
  279.           The flags that may be used are:
  280.  
  281.           -d   Generate code to print source  listing  file  name  and
  282.                line  number  when a run-time error occurs. This can be
  283.                useful for debugging, but takes up process space.   De-
  284.                faults to off.
  285.  
  286.           -f   Forces code to be on the same line in the  output  file
  287.                as it is in the input file to ease interpreting C diag-
  288.                nostic messages.  EQUEL will usually try to get  all  C
  289.                code lines in the output file on the same lines as they
  290.                were in the input file.  Sometimes  it  must  break  up
  291.                queries into several lines to avoid C-preprocessor line
  292.                overflows, possibly  moving  some  C  code  ahead  some
  293.                lines.  With the -_f flag specified this will never hap-
  294.                pen and, though the line buffer may overflow,  C  lines
  295.                will  be on the right line.  This is useful for finding
  296.                the line in the source file that C error diagnostics on
  297.                the output file refer to.
  298.  
  299.           -r   Resets flags to default values.  Used to supress  other
  300.                flags for some of the files in the argument list.
  301.  
  302.           The output files may than be compiled using the C compiler:
  303.  
  304.                _c_c file1.c file2.c ... -_l_q
  305.  
  306.           The -_l_q requests the use of the EQUEL object library.
  307.  
  308.           All EQUEL routines and globals  begin  with  the  characters
  309.           "II",  and  so  all globals variables and procedure names of
  310.           the form II_x_x_x are reserved for use by EQUEL and  should  be
  311.           avoided by EQUEL users.
  312.  
  313.           _B_a_s_i_c _S_y_n_t_a_x
  314.  
  315.           EQUEL commands are indicated by lines  which  begin  with  a
  316.           double  pound  sign (``##'').  Other lines are simply copied
  317.           as is.  All normal INGRES commands may be used in EQUEL  and
  318.           have  the  same effect as if invoked through the interactive
  319.           terminal monitor.  Only retrieve commands with no result re-
  320.           lation specified have a different syntax and meaning.
  321.  
  322.           The format of retrieve without a result relation is modified
  323.           to:
  324.  
  325.                ## retrieve (C-variable = a_fcn { , C-variable =  a_fcn
  326.                } )
  327.  
  328.           optionally followed (immediately) by:
  329.  
  330.                ##      [ _w_h_e_r_e _q_u_a_l ]
  331.                ## {
  332.                        /* C-code */
  333.                ## }
  334.  
  335.           This statement causes the ``C-code'' to be executed once for
  336.           each tuple retrieved, with the ``C-variable''s set appropri-
  337.           ately.  Numeric values of any type are converted  as  neces-
  338.           sary.   No  conversion is done between numeric and character
  339.           values.  (The normal INGRES _a_s_c_i_i function may be  used  for
  340.           this purpose.)
  341.  
  342.           Also, the following EQUEL commands are permitted.
  343.  
  344.           ## _i_n_g_r_e_s [ingres flags] data_base_name
  345.                This command starts INGRES  running,  and  directs  all
  346.                dynamically   following   queries   to   the   database
  347.                _d_a_t_a__b_a_s_e__n_a_m_e.  It is a run-time error to execute this
  348.                command  twice  without  an intervening ``## exit'', as
  349.                well as to issue queries while an ``## ingres''  state-
  350.                ment is not in effect.  Each flag should be enclosed in
  351.                quotes to avoid confusion in the EQUEL parser:
  352.  
  353.                        ## ingres "-f4f10.2" "-i212" demo
  354.  
  355.           ## _e_x_i_t
  356.                Exit simply exits from INGRES.  It is equivalent to the
  357.                _\_q command to the teletype monitor.
  358.  
  359.           _P_a_r_a_m_e_t_r_i_z_e_d _Q_u_e_l _S_t_a_t_e_m_e_n_t_s
  360.  
  361.           Quel statements with target lists may  be  ``parametrized''.
  362.           This  is  indicated by preceding the statement with the key-
  363.           word ``param''.  The target list of a parametrized statement
  364.           has the form:
  365.  
  366.                   ( _t_l__v_a_r, _a_r_g_v )
  367.  
  368.           where _t_l__v_a_r is taken to be a string  pointer  at  execution
  369.           time  (it  may be a string constant) and interpreted as fol-
  370.           lows.  For any parametrized EQUEL  statement  except  a  re-
  371.           trieve without a result relation (no ``into rel'') (i.e. ap-
  372.           pend, copy,  create,  replace,  retrieve  into)  the  string
  373.           _t_l__v_a_r  is  taken  to  be  a regular target list except that
  374.           wherever a `%' appears a valid INGRES type (f4, f8, i2,  i4,
  375.           c)  is expected to follow.  Each of these is replaced by the
  376.           value of the corresponding entry into _a_r_g_v (starting  at  0)
  377.           which  is  interpreted  to be a pointer to a variable of the
  378.           type indicated by the `%' sequence.  Neither  _a_r_g_v  nor  the
  379.           variables which it points to need be declared to EQUEL.  For
  380.           example:
  381.  
  382.                char    *argv[10];
  383.  
  384.                        argv[0] = &double_var;
  385.                        argv[1] = &int_var;
  386.                ##      param append to rel
  387.                ##              ("dom1 = %f8, dom2 = %i2", argv)
  388.                ##      /* to escape the "%<ingres_type>" mechanism use "%%" */
  389.                ##      /* This places a single `%' in the string. */
  390.  
  391.           On a retrieve to C-variables, within _t_l__v_a_r, instead of  the
  392.           C-variable  to  retrieve into, the same `%' escape sequences
  393.           are used to denote the type of the corresponding argv  entry
  394.           into which the value will be retrieved.
  395.  
  396.           The qualification of any query may be replaced by  a  string
  397.           valued  variable,  whose contents is interpreted at run time
  398.           as the text of the qualification.
  399.  
  400.           The _c_o_p_y statement may also be parametrized.   The  form  of
  401.           the parametrized _c_o_p_y is analogous to the other parametrized
  402.           statements: the target list may be parametrized in the  same
  403.           manner  as  the  _a_p_p_e_n_d  statements,  and  furthermore,  the
  404.           _f_r_o_m/_i_n_t_o keyword may be replaced by a string  valued  vari-
  405.           able whose content at run time should be _i_n_t_o or _f_r_o_m.
  406.  
  407.           _D_e_c_l_a_r_a_t_i_o_n_s
  408.  
  409.           Any valid C variable declaration on a line beginning with  a
  410.           ``##''  declares  a  C-variable that may be used in an EQUEL
  411.           statement and as a normal variable.  All variables  must  be
  412.           declared  before being used.  Anywhere a constant may appear
  413.           in an INGRES command, a C-variable may appear.  The value of
  414.           the C-variable is substituted at execution time.
  415.  
  416.           Neither nested structures nor variables of type _c_h_a_r (as op-
  417.           posed  to  pointer  to  char  or array of char) are allowed.
  418.           Furthermore, there are two restrictions in the way variables
  419.           are referenced within EQUEL statements.  All variable usages
  420.           must be dereferenced  and/or  subscripted  (for  arrays  and
  421.           pointers),  or  selected  (for structure variables) to yield
  422.           lvalues (scalar values).  _C_h_a_r variables are used  by  EQUEL
  423.           as  a means to use _s_t_r_i_n_g_s.  Therefore when using a _c_h_a_r ar-
  424.           ray or pointer it must be dereferenced only to a ``_c_h_a_r *''.
  425.           Also,  variables  may  not  have parentheses in their refer-
  426.           ences.  For example:
  427.  
  428.                ## struct xxx
  429.                ## {
  430.                        int     i;
  431.                ##      int     *ip;
  432.                ## }    **struct_var;
  433.  
  434.                /* not allowed */
  435.                ##      delete p where p.ifield = *(*struct_var)->ip
  436.  
  437.                /* allowed */
  438.                ##      delete p where p.ifield = *struct_var[0]->ip
  439.  
  440.           C variables declared to EQUEL have either  global  or  local
  441.           scope.   Their scope is local if their declaration is within
  442.           a free (not bound to a retrieve) block  declared  to  EQUEL.
  443.           For example:
  444.  
  445.                /* globals scope variable */
  446.                ## int  Gint;
  447.  
  448.                func(i)
  449.                int     i;
  450.                ## {
  451.                        /* local scope variable */
  452.                ##      int     *gintp;
  453.                        ...
  454.                ## }
  455.  
  456.           If a variable of one of the char types is used  almost  any-
  457.           where  in an EQUEL statement the content of that variable is
  458.           used at run time.  For example:
  459.  
  460.                ##      char    *dbname[MAXDATABASES + 1];
  461.                        int     current_db;
  462.                        dbname[current_db] = "demo";
  463.                ##      ingres dbname[current_db]
  464.  
  465.           will cause INGRES to be invoked  with  data  base  ``demo''.
  466.           However,  if  a variable's name is to be used as a constant,
  467.           then the non-referencing operator `#' should be  used.   For
  468.           example:
  469.  
  470.                ## char *demo;
  471.  
  472.                        demo = "my_database";
  473.  
  474.                        /* ingres -d my_database */
  475.                ##      ingres "-d" demo
  476.  
  477.                        /* ingres -d demo */
  478.                ##      ingres "-d" #demo
  479.  
  480.           The C-preprocessor's #include feature may be used  on  files
  481.           containing  equel statements and declarations if these files
  482.           are named _a_n_y_t_h_i_n_g._q._h.  An EQUEL processed version  of  the
  483.           file, which will be #included by the C-preprocessor, is left
  484.           in _a_n_y_t_h_i_n_g._c._h.
  485.  
  486.           _E_r_r_o_r_s _a_n_d _I_n_t_e_r_r_u_p_t_s
  487.  
  488.           INGRES and run-time EQUEL errors cause the  routine  _I_I_e_r_r_o_r
  489.           to  be  called,  with the error number and the parameters to
  490.           the error in an array of string pointers as in a C  language
  491.           main  routine.   The  error  message  will  be looked up and
  492.           printed. before printing  the  error  message,  the  routine
  493.           (*IIprint_err)()  is  called  with  the  error  number  that
  494.           ocurred  as  its  single   argument.   The   error   message
  495.           corresponding    to    the    error   number   returned   by
  496.           (*IIprint_err)()  will  be  printed.    Printing   will   be
  497.           supressed if (*IIprint_err)() returns 0.  IIprint_err may be
  498.           reassigned to, and is useful for programs which  map  INGRES
  499.           errors  into  their own error messages.  In addition, if the
  500.           ``-_d'' flag was set the file name and line number of the er-
  501.           ror  will be printed.  The user may write an IIerror routine
  502.           to do other tasks as long as the setting of IIerrflag is not
  503.           modified as this is used to exit retrieves correctly.
  504.  
  505.           Interrupts are caught by equel if they  are  not  being  ig-
  506.           nored.  This insures that the rest of INGRES is in sync with
  507.           the EQUEL process.  There is a  function  pointer,  IIinter-
  508.           rupt, which points to a function to call after the interrupt
  509.           is caught. The user may use this to service  the  interrupt.
  510.           It  is  initialized to "exit()" and is called with -1 as its
  511.           argument.  For example:
  512.  
  513.                   extern int (*IIinterrupt)();
  514.                   extern reset();
  515.  
  516.                   setexit();
  517.                   IIinterrupt = reset;
  518.                   mainloop();
  519.  
  520.           To ignore interrupts, signal() should be called  before  the
  521.           ## ingres satatement is executed.
  522.  
  523.      FILES
  524.           .../files/error8_*
  525.                Can be used  by  the  user  to  decipher  INGRES  error
  526.                numbers.
  527.           .../lib/libq.a
  528.                Run time library.
  529.  
  530.      SEE ALSO
  531.           .../doc/other/equeltut.q, C reference manual,  ingres(UNIX),
  532.           quel(QUEL)
  533.  
  534.      BUGS
  535.           The C-code embedded in the tuple-by-tuple retrieve operation
  536.           may  not contain additional QUEL statements or recursive in-
  537.           vocations of INGRES.
  538.  
  539.           There is no way to specify an _i_1 format C-variable.
  540.  
  541.           Includes of an equel  file  within  a  parameterized  target
  542.           list,  or within a C variable's array subscription brackets,
  543.           isn't done correctly.
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.      HELPR(UNIX)                  3/14/79                  HELPR(UNIX)
  551.  
  552.  
  553.  
  554.      NAME
  555.           helpr - get information about a database.
  556.  
  557.      SYNOPSIS
  558.           _h_e_l_p_r [ -_u_n_a_m_e ] [ +__w ] database relation ...
  559.  
  560.      DESCRIPTION
  561.           _H_e_l_p_r gives information about the named relation(s)  out  of
  562.           the database specified, exactly like the _h_e_l_p command.
  563.  
  564.           Flags accepted are -_u and +__u.  Their meanings are  identical
  565.           to the meanings of the same flags in INGRES.
  566.  
  567.      SEE ALSO
  568.           ingres(unix), help(quel)
  569.  
  570.      DIAGNOSTICS
  571.           bad flag - you have specified a flag which is not  legal  or
  572.               is in bad format.
  573.           you may not access database - this database is prohibited to
  574.               you based on status information in the users file.
  575.           cannot access database - the database does not exist.
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.      INGRES(UNIX)                 3/14/79                 INGRES(UNIX)
  584.  
  585.  
  586.  
  587.      NAME
  588.           ingres - INGRES relational data base management system
  589.  
  590.      SYNOPSIS
  591.           _i_n_g_r_e_s [ _f_l_a_g_s ] dbname [ process_table ]
  592.  
  593.      DESCRIPTION
  594.           This is the UNIX command which is  used  to  invoke  INGRES.
  595.           Dbname  is  the name of an existing data base.  The optional
  596.           flags have the following meanings (a ``+_''  means  the  flag
  597.           may  be stated ``+_x'' to set option _x or ``-_x'' to clear op-
  598.           tion _x.  ``-'' alone means that ``-_x'' must be stated to get
  599.           the _x function):
  600.  
  601.           +_U        Enable/disable direct update of the  system  rela-
  602.                     tions  and  secondary indicies.  You must have the
  603.                     000004 bit in the status field of the  users  file
  604.                     set  for this flag to be accepted.  This option is
  605.                     provided for  system  debugging  and  is  strongly
  606.                     discouraged for normal use.
  607.           -uname    Pretend you are the  user  with  login  name  _n_a_m_e
  608.                     (found in the users file).  If _n_a_m_e is of the form
  609.                     :_x_x, _x_x is the two character user code of a  user.
  610.                     This  may only be used by the DBA for the database
  611.                     or by the INGRES superuser.
  612.           -cN       Set the minimum field width for printing character
  613.                     domains to _N.  The default is 6.
  614.           -ilN      Set integer output field width to _N.  _l may be  1,
  615.                     2, or 4 for i1's, i2's, or i4's repectively.
  616.           -flxM.N   Set floating point output field width to _M charac-
  617.                     ters  with  _N  decimal places.  _l may be 4 or 8 to
  618.                     apply to f4's or f8's respectively.  _x may  be  _e,
  619.                     _E,  _f,  _F, _g, _G, _n, or _N to specify an output for-
  620.                     mat.  _E is exponential form, _F is  floating  point
  621.                     form,  and  _G  and _N are identical to _F unless the
  622.                     number is too big to fit in that field, when it is
  623.                     output  in  _E format.  _G format guarantees decimal
  624.                     point alignment; _N does not.  The  default  format
  625.                     for both is _n_1_0._3.
  626.           -vX       Set the column seperator for retrieves to the ter-
  627.                     minal  and print commands to be _X.  The default is
  628.                     vertical bar.
  629.           -rM       Set modify mode on the _r_e_t_r_i_e_v_e command to  _M.   _M
  630.                     may  be  _i_s_a_m,  _c_i_s_a_m,  _h_a_s_h,  _c_h_a_s_h, _h_e_a_p, _c_h_e_a_p,
  631.                     _h_e_a_p_s_o_r_t, or _c_h_e_a_p_s_o_r_t, for ISAM, compressed ISAM,
  632.                     hash   table,   compressed   hash   table,   heap,
  633.                     compressed heap, sorted heap, or compressed sorted
  634.                     heap.  The default is ``cheapsort''.
  635.           -nM       Set modify mode on the _i_n_d_e_x command to _M.  _M  can
  636.                     take  the  same  values as the -_r flag above.  De-
  637.                     fault is ``isam''.
  638.           +_a        Set/clear the autoclear  option  in  the  terminal
  639.                     monitor.  It defaults to set.
  640.           +_b        Set/reset batch update.  Users must the 000002 bit
  641.                     set in the status field of the users file to clear
  642.                     this flag.   This  flag  is  normally  set.   When
  643.                     clear,  queries  will  run slightly faster, but no
  644.                     recovery can take place.  Queries which  update  a
  645.                     secondary  index  automatically  set this flag for
  646.                     that query only.
  647.           +_d        Print/don't print the dayfile.  Normally set.
  648.           +_s        Print/don't print any of the monitor messages, in-
  649.                     cluding  prompts.  This flags is normally set.  If
  650.                     cleared, it also clears the -_d flag.
  651.           +_w        Wait/don't wait for the database.  If the +_w  flag
  652.                     is  present, INGRES will wait if certain processes
  653.                     are running (purge,restore, and/or sysmod) on  the
  654.                     given   data   base.   Upon  completion  of  those
  655.                     processes INGRES will proceed.  If the -_w flag  is
  656.                     present,  a  message  is  returned  and  execution
  657.                     stopped if the data base is not available.  If the
  658.                     +__w  flag  is omitted and the data base is unavail-
  659.                     able, the error message is returned if  INGRES  is
  660.                     running  in foreground (more precisly if the stan-
  661.                     dard input is from a terminal), otherwise the wait
  662.                     option is invoked.
  663.  
  664.           _P_r_o_c_e_s_s__t_a_b_l_e is the pathname of a UNIX file  which  may  be
  665.           used  to specify the run-time configuration of INGRES.  This
  666.           feature is intended for use in system maintenance only,  and
  667.           its  unenlightened  use  by  the  user community is strongly
  668.           discouraged.
  669.  
  670.           Note: It  is  possible  to  run  the  monitor  as  a  batch-
  671.           processing interface using the `<', `>' and `|' operators of
  672.           the UNIX  shell,  provided  the  input  file  is  in  proper
  673.           monitor-format.
  674.  
  675.      EXAMPLE
  676.           ingres demo
  677.           ingres -d demo
  678.           ingres -s demo < batchfile
  679.           ingres -f4g12.2 -i13 +b -rhash demo
  680.  
  681.      FILES
  682.           .../files/users - valid INGRES users
  683.           .../data/base/* - data bases
  684.           .../datadir/* - for compatability with previous versions
  685.           .../files/proctab8 - runtime configuration file
  686.  
  687.  
  688.      SEE ALSO
  689.           monitor(quel)
  690.  
  691.      DIAGNOSTICS
  692.           Too many options to INGRES - you have stated too many  flags
  693.               as INGRES options.
  694.           Bad flag format - you have stated a flag in a  format  which
  695.               is not intelligible, or a bad flag entirely.
  696.           Too many parameters - you have given a database name, a pro-
  697.               cess  table  name,  and  ``something else'' which INGRES
  698.               doesn't know what to do with.
  699.           No database name specified
  700.           Improper database name - the database name is not legal.
  701.           You may not access database _n_a_m_e - according  to  the  users
  702.               file, you do not have permission to enter this database.
  703.           You are not authorized to use  the  _f_l_a_g  flag  -  the  flag
  704.               specified requires some special authorization, such as a
  705.               bit in the users file, which you do not have.
  706.           Database _n_a_m_e does not exist
  707.           You are not a valid INGRES user - you have not been  entered
  708.               into  the  users  file, which means that you may not use
  709.               INGRES at all.
  710.           You may not specify this process table - special  authoriza-
  711.               tion is needed to specify process tables.
  712.           Database temporarily unavailable - someone else is currently
  713.               performing some operation on the database which makes it
  714.               impossible for you  to  even  log  in.   This  condition
  715.               should disappear shortly.
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.      PRINTR(UNIX)                 3/14/79                 PRINTR(UNIX)
  724.  
  725.  
  726.  
  727.      NAME
  728.           printr - print relations
  729.  
  730.      SYNOPSIS
  731.           _p_r_i_n_t_r [ _f_l_a_g_s ] database relation ...
  732.  
  733.      DESCRIPTION
  734.           _P_r_i_n_t_r prints the named  relation(s)  out  of  the  database
  735.           specified, exactly like the _p_r_i_n_t command.  Retrieve permis-
  736.           sion must be granted to all people to execute this command.
  737.  
  738.           Flags accepted are -_u, +__w, -_c, -_i, -_f, and -_v.  Their  mean-
  739.           ings  are  identical  to  the  meanings of the same flags in
  740.           INGRES.
  741.  
  742.      SEE ALSO
  743.           ingres(unix), print(quel)
  744.  
  745.      DIAGNOSTICS
  746.           bad flag - you have specified a flag which is not  legal  or
  747.               is in bad format.
  748.           you may not access database - this database is prohibited to
  749.               you based on status information in the users file.
  750.           cannot access database - the database does not exist.
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.      PURGE(UNIX)                  3/14/79                  PURGE(UNIX)
  759.  
  760.  
  761.  
  762.      NAME
  763.           purge - destroy all expired and temporary relations
  764.  
  765.      SYNOPSIS
  766.           _p_u_r_g_e [ -_f ] [ -_p ] [ -_a ] [ -_s ] [ +__w ] [ database ... ]
  767.  
  768.      DESCRIPTION
  769.           _P_u_r_g_e searches the named databases deleting system temporary
  770.           relations.   When  using the -_p flag, expired user relations
  771.           are deleted.  The -_f flag will cause unrecognizable files to
  772.           be deleted, normally purge will just report these files.
  773.  
  774.           Only the database administrator (the DBA) for a database may
  775.           run  purge,  except the INGRES superuser may purge any data-
  776.           base by using the -_s flag.
  777.  
  778.           If no databases are specified all databases  for  which  you
  779.           are the DBA will be purged.  All databases will be purged if
  780.           the INGRES superuser has specified the -_s flag.  The -_a flag
  781.           will cause purge to print a message about the pending opera-
  782.           tion and execute it only if the response if a `y'.  Any oth-
  783.           er response is interpreted as ``no''.
  784.  
  785.           _P_u_r_g_e will lock the data base while it is  being  processed,
  786.           since errors may occur if the database is active while purge
  787.           is working on the database.  If a data base  is  busy  _p_u_r_g_e
  788.           will  report  this  and go on to the next data base, if any.
  789.           If standard input is not a terminal _p_u_r_g_e will wait for  the
  790.           data  base  to be free.  If -_w flag is stated _p_u_r_g_e will not
  791.           wait, regardless of standard  input.   The  +_w  flag  causes
  792.           _p_u_r_g_e to always wait.
  793.  
  794.      EXAMPLES
  795.           purge -p +w tempdata
  796.           purge -a -f
  797.  
  798.      SEE ALSO
  799.           save(quel), restore(unix)
  800.  
  801.      DIAGNOSTICS
  802.           who are you? - you are not entered into the users file.
  803.           not ingres superuser - you have tried to use the -_s flag but
  804.               you are not the INGRES superuser.
  805.           you are not the dba - you have tried to purge a database for
  806.               which you are not the DBA.
  807.           cannot access database - the database does not exist.
  808.  
  809.      BUGS
  810.           If no database names are given, only the  databases  located
  811.           in the directory _d_a_t_a/_b_a_s_e are purged, and not the old data-
  812.           bases in _d_a_t_a_d_i_r.  Explicit database names  still  work  for
  813.           databases in either directory.
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.      RESTORE(UNIX)                3/14/79                RESTORE(UNIX)
  822.  
  823.  
  824.  
  825.      NAME
  826.           restore - recover from an INGRES or UNIX crash.
  827.  
  828.      SYNOPSIS
  829.           _r_e_s_t_o_r_e [ -_a ] [ -_s ] [ +__w ] [ database ... ]
  830.  
  831.      DESCRIPTION
  832.           _R_e_s_t_o_r_e is used to restore a data base after  an  INGRES  or
  833.           UNIX crash.  It should always be run after any abnormal ter-
  834.           mination to ensure the integrity of the data base.
  835.  
  836.           In order to run restore, you must be the DBA for  the  data-
  837.           base  you  are restoring or the INGRES superuser and specify
  838.           the -_s flag.
  839.  
  840.           If no databases are specified then all databases  for  which
  841.           you  are  the  DBA  are restored.  All databases will be re-
  842.           stored if the INGRES superuser has specified the -_s flag.
  843.  
  844.           If the -_a flag is specified you will be asked before restore
  845.           takes any serious actions.  It is advisable to use this flag
  846.           if  you  suspect  the  database  is  in  bad  shape.   Using
  847.           /dev/null as input with the -_a flag will provide a report of
  848.           problems in the data base.  If there were  no  errors  while
  849.           restoring  a  database,  _p_u_r_g_e will be called, with the same
  850.           flags that were given to _r_e_s_t_o_r_e, to remove  unwanted  files
  851.           and  system  temporaries.  _R_e_s_t_o_r_e may be called with the -_f
  852.           and/or -_p flags for _p_u_r_g_e.  Unrecognized files  and  expired
  853.           relations are not removed unless the proper flags are given.
  854.           In the case of an incomplete destroy, create  or  index  _r_e_-
  855.           _s_t_o_r_e  will  not  delete files for partially created or des-
  856.           troyed relations.  _P_u_r_g_e must be called with the -_f flag  to
  857.           accomplish this.
  858.  
  859.           _R_e_s_t_o_r_e locks the data base while it is being processed.  If
  860.           a  data  base  is busy _r_e_s_t_o_r_e will report this and go on to
  861.           the next data base.  If standard input is not a terminal _r_e_-
  862.           _s_t_o_r_e  will  wait  for  the data base to be free.  If the -_w
  863.           flag is set _r_e_s_t_o_r_e will not wait regardless of standard in-
  864.           put.  If +_w is set it will always wait.
  865.  
  866.           _R_e_s_t_o_r_e can recover a database from an update which had fin-
  867.           ished filling the batch file.  Updates which did not make it
  868.           to this stage should be  rerun.   Similarly  modifies  which
  869.           have finished recreating the relation will be completed (the
  870.           relation relation and attribute relations will be  updated).
  871.           If  a  destroy was in progress it will be carried to comple-
  872.           tion, while a create will almost always be backed out.  Des-
  873.           troying a relation with an index should destroy the index so
  874.           _r_e_s_t_o_r_e may report that a secondary relation has been  found
  875.           with no primary.
  876.  
  877.           If interrupt (signal 2) is received the current database  is
  878.           closed  and the next, if any, is processed.  Quit (signal 3)
  879.           will cause restore to terminate.
  880.  
  881.      EXAMPLE
  882.           restore -f demo
  883.           restore -a grants < /dev/null
  884.  
  885.      DIAGNOSTICS
  886.           All diagnostics are followed by a tuple from a system  rela-
  887.           tions.
  888.  
  889.           ``No relation for attribute(s)''  -  the  attributes  listed
  890.                have no corresponding entry in the relation relation
  891.           ``No primary relation for index'' - the tuple printed is the
  892.                relation tuple for a secondary index for which there is
  893.                no primary relation.  The  primary  probably  was  des-
  894.                troyed the secondary will be.
  895.           ``No indexes entry for primary relation'' - the tuple is for
  896.                a  primary relation, the relindxd domain will be set to
  897.                zero.  This is the product of an incomplete destroy.
  898.           ``No indexes entry for index'' - the tuple is for  a  secon-
  899.                dary  index,  the index will be destroyed.  This is the
  900.                product of an incomplete destroy.
  901.           ``_r_e_l_n_a_m_e is index for'' - an index has  been  found  for  a
  902.                primary  which  is  not marked as indexed.  The primary
  903.                will be so marked.  This is probably the product of  an
  904.                incomplete  index  command.   The  index will have been
  905.                created properly but not modified.
  906.           ``No file for'' - There is no data for this relation  tuple,
  907.                the  tuple  will  be deleted.  If, under the -_a option,
  908.                the tuple is not deleted purge will not be called.
  909.           ``No secondary index for indexes entry'' - An entry has been
  910.                found  in  the indexes relation for which the secondary
  911.                index does not exist (no relation relation tuple).  The
  912.                entry will be deleted.
  913.  
  914.      SEE ALSO
  915.           purge(unix)
  916.  
  917.      BUGS
  918.           If no database names are given, only the  databases  located
  919.           in the directory _d_a_t_a/_b_a_s_e are restored, and not the old da-
  920.           tabases in _d_a_t_a_d_i_r.  Explicit database names still work  for
  921.           databases in either directory.
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.      SYSMOD(UNIX)                 3/14/79                 SYSMOD(UNIX)
  930.  
  931.  
  932.  
  933.      NAME
  934.           sysmod - modify system relations  to  predetermined  storage
  935.           structures.
  936.  
  937.      SYNOPSIS
  938.           _s_y_s_m_o_d [ -_s ] [ -_w ] dbname [ _r_e_l_a_t_i_o_n ]  [  _a_t_t_r_i_b_u_t_e  ]  [
  939.           _i_n_d_e_x_e_s ] [ _t_r_e_e ] [ _p_r_o_t_e_c_t ] [ _i_n_t_e_g_r_i_t_i_e_s ]
  940.  
  941.      DESCRIPTION
  942.           _S_y_s_m_o_d will modify the relation, attribute,  indexes,  tree,
  943.           protect,  and  integrities relations to hash unless at least
  944.           one of the _r_e_l_a_t_i_o_n, _a_t_t_r_i_b_u_t_e, _i_n_d_e_x_e_s, _t_r_e_e,  _p_r_o_t_e_c_t,  or
  945.           _i_n_t_e_g_r_i_t_i_e_s  parameters  are given, in which case only those
  946.           relations given as parameters are modified.  The system  re-
  947.           lations are modified to gain maximum access performance when
  948.           running INGRES.  The user must be the data base  administra-
  949.           tor  for  the specified database, or be the INGRES superuser
  950.           and have the -_s flag stated.
  951.  
  952.           _S_y_s_m_o_d should be run on a data base when it is first created
  953.           and  periodically  thereafter  to maintain peak performance.
  954.           If many relations and secondary indices are  created  and/or
  955.           destroyed, _s_y_s_m_o_d should be run more often.
  956.  
  957.           If the data base is being used while _s_y_s_m_o_d is running,  er-
  958.           rors  will occur.  Therefore, _s_y_s_m_o_d will lock the data base
  959.           while it is being processed.  If the data base is busy, _s_y_s_-
  960.           _m_o_d  will  report this.  If standard input is not a terminal
  961.           _s_y_s_m_o_d will wait for the data base to be free.  If  -_w  flag
  962.           is  stated  _s_y_s_m_o_d will not wait, regardless of standard in-
  963.           put.  The +_w flag causes _s_y_s_m_o_d to always wait.
  964.  
  965.           The system relations are modified to hash; the relation  re-
  966.           lation is keyed on the first domain, the indexes, attribute,
  967.           protect, and integrities relations are keyed  on  the  first
  968.           two  domains, and the tree relation is keyed on domains one,
  969.           two, and five.  The relation and  attribute  relations  have
  970.           the minpages option set at 10, the indexes, protect, and in-
  971.           tegrities relations have the minpages value set at 5.
  972.  
  973.      SEE ALSO
  974.           modify(quel)
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.      USERSETUP(UNIX)              3/14/79              USERSETUP(UNIX)
  982.  
  983.  
  984.  
  985.      NAME
  986.           usersetup - setup users file
  987.  
  988.      SYNOPSIS
  989.           .../_b_i_n/_u_s_e_r_s_e_t_u_p [ flags [ pathname ] ]
  990.  
  991.      DESCRIPTION
  992.           The /_e_t_c/_p_a_s_s_w_d file is read and reformatted to  become  the
  993.           INGRES users file, stored into .../_f_i_l_e_s/_u_s_e_r_s.  If _p_a_t_h_n_a_m_e
  994.           is specified, it replaces ``...''.  If  pathname  is  ``-'',
  995.           the result is written to the standard output.
  996.  
  997.           The user name, user, and group id's are  initialized  to  be
  998.           identical  to  the  corresponding  entry  in the /_e_t_c/_p_a_s_s_w_d
  999.           file.  The status field is initialized to be 000001,  except
  1000.           for user _i_n_g_r_e_s, which is initialized to all permission bits
  1001.           set.  If the _s_t_a_t_u_s parameter is provided, the field is  set
  1002.           to  this  instead.  The ``initialization file'' parameter is
  1003.           set to the file ._i_n_g_r_e_s in the user's login directory.   The
  1004.           user code field is initialized with sequential two-character
  1005.           codes.  All other fields are initialized to be null.
  1006.  
  1007.           After running _u_s_e_r_s_e_t_u_p, the _u_s_e_r_s file must be edited.  Any
  1008.           users who are to have any special authorizations should have
  1009.           the status field changed, according to the specifications in
  1010.           users(files).   To  disable a user from executing INGRES en-
  1011.           tirely, completely remove her line from the users file.
  1012.  
  1013.           As UNIX users are added  or  deleted  from  the  /_e_t_c/_p_a_s_s_w_d
  1014.           file,  the _u_s_e_r_s file will need to be editted to reflect the
  1015.           changes.  For deleted users, it is only necessary to  delete
  1016.           the  line for that user from the _u_s_e_r_s file.  To add a user,
  1017.           you must assign that user a code in the form "aa" and  enter
  1018.           a line in the users file in the form:
  1019.                   name:cc:uid:gid:status:flags:proctab:initfile::databases
  1020.           where  _n_a_m_e  is the user name (taken from the first field of
  1021.           the /_e_t_c/_p_a_s_s_w_d file entry for this user), _c_c  is  the  user
  1022.           code assigned, which must be exactly two characters long and
  1023.           must not be the same as any other existing user  codes,  _u_i_d
  1024.           and _g_i_d are the user and group ids (taken from the third and
  1025.           fourth fields in  the  /_e_t_c/_p_a_s_s_w_d  entry),  _s_t_a_t_u_s  is  the
  1026.           status  bits  for  this user, normally 000000, _f_l_a_g_s are the
  1027.           default flags for INGRES (on a per-user basis),  _p_r_o_c_t_a_b  is
  1028.           the  default  process table for this user (which defaults to
  1029.           =_p_r_o_c_t_a_b_8), and _d_a_t_a_b_a_s_e_s is a list of  the  databases  this
  1030.           user may enter.  If null, she may use all databases.  If the
  1031.           first character is a dash (``-''),  the  field  is  a  comma
  1032.           separated list of databases which she may not enter.  Other-
  1033.           wise, it is a list of databases which she may enter.
  1034.  
  1035.           The _d_a_t_a_b_a_s_e_s field includes the names  of  databases  which
  1036.           may be created.
  1037.  
  1038.           _U_s_e_r_s_e_t_u_p may be executed only once, to initially create the
  1039.           _u_s_e_r_s file.
  1040.  
  1041.      FILES
  1042.           .../files/users
  1043.           /etc/passwd
  1044.  
  1045.      SEE ALSO
  1046.           ingres(unix), passwd(5), users(files)
  1047.  
  1048.      BUGS
  1049.           It should be able to bring the _u_s_e_r_s file up to date.
  1050.  
  1051.  
  1052.